package com.booter.hessian.client;

import com.booter.hessian.service.HessianTestService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.File;
import java.io.FileInputStream;

public class HessianClientTest {

    public static void main(String[] args) throws Exception {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("spring-hessian-client.xml");
        HessianTestService ts = (HessianTestService) ctx.getBean("hessianTestService");
        Long t = System.currentTimeMillis();
        for (int i = 0; i < 100; i++) {
            System.out.println("ret==" + ts.say("xxxx-" + i));
        }
        System.out.println(System.currentTimeMillis() - t);
        //文件上传
        ts.upload("sss.pdf", new FileInputStream(new File("d:\\s\\1111.pdf")));
    }

}
